/**
XenSim simulates xenbal.
Copyright (C) 2006 Travis Vachon

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
package xensim;

import java.util.PriorityQueue;
import java.util.Vector;

public class SimGlobals {
	public static final long KB = 8192;
	public static final long Kb = 1024;
	public static final long MB = 8388608;
	public static final long Mb = 1048576;
	
	public static final long GB = 8589934592l;
	public static final long Gb = 1073741824;
	
	public static final long TIME_CONSTANT = 1000;
	public static final long MINIMUM_CPU_TIME = 1;
	public static int DOMAIN_RUN_QUANTUM = 25;
	
	public static final boolean DEBUG = true;
	public static final long IDLE_TIME_QUANTUM = 10;
	
	public static final long OPT_LOAD_QUERY_TIME = TIME_CONSTANT/10;
	public static final double LOAD_THRESHOLD = 0.5;
	public static final double FULLY_LOADED_THRESHOLD = 0.95;
	public static final double UNLOADED_THRESHOLD = 0.3;
	public static final double PEER_LOAD_THRESHOLD = 0.7;
	public static final long BALANCER_INTERVAL = TIME_CONSTANT;
	public static final long LOAD_MEMORY_TIME = TIME_CONSTANT;
	public static final long MONITOR_TIME = TIME_CONSTANT;
	public static final double AVERAGE_DOM0_CPU_USE = .2;
	public static final double DOM0_CPU_USE_STD_DEV = .1;
	public static final long MIN_NODE_TIME = 5;
	public static final long LOAD_UPDATE_TIME = MONITOR_TIME / 100;
	
	public double currentTime;
	public PriorityQueue<Event> eventQueue;
	public long minimumMigrationBandwidth = 50*Mb/SimGlobals.TIME_CONSTANT;
	public long maximumMigrationBandwidth = 500*Mb/SimGlobals.TIME_CONSTANT;
	public Vector<Node> nodes;
	
	public SimGlobals(Vector<Node> nodes){
		eventQueue = new PriorityQueue<Event>();
		currentTime = 0;
		this.nodes = nodes;
	}
}
